<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>教师信息</title>
    <script src="/jquery/jquery-3.6.0.js"></script>
    <style>
        /**
        * Important properties to make this animation work:

        * backface-visibility: hidden;
          * Hide the back of the card until it should be visible
          * https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility

        * transform-style: preserve-3d;
          * Makes children elements positioned in 3D space. Default is flat.
          * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-style

        * transform: translateZ(100px);
          * Moves elements closer to or further away from the the viewer
          * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translateZ

        * perspective: 1200px;
          * Setting the distance between the element and the user
            to determine perspective of 3D elements
          * Lowering this value will make the animation more "in your face"
          * https://developer.mozilla.org/en-US/docs/Web/CSS/perspective

        */


        body {
            background: linear-gradient(to right, #141e30, #243b55);
        }

        h1, h2, h3, h4, p {
            color: #FFFFFF;
            font-family: Arial, sans-serif;
        }


        .header {
            text-align: center;
        }
        span {
            padding-right: 5px;
        }




        CARD
        .cards-wrapper {
            margin-top: 50px;
        }

        .card-container {
            perspective: 1200px;
        }

        .card {
            margin: 0 auto;
            height: 500px;
            width: 500px;
            max-width: 80%;
            position: relative;
            border-radius: 25px;
            transition: all 1s ease;
            transform-style: preserve-3d;
            box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.2)
        }

        .rotated {
            transform: rotateY(-180deg);
        }

        .card-contents {
            width: 100%;
            height: 100%;
            border-radius: 25px;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            text-align: center;
            position: absolute;
            top: 0;
            left: 0;
            backface-visibility: hidden;

        h2, p {
            text-shadow: 1px 2px 2px rgba(0, 0, 0, 0.2);
        }

        h2 {
            font-size: 3em;
            margin: 0 auto;
        }

        hr {
            width: 50%;
            margin: 20px auto;
        }

        p {
            margin: 0 auto;
        }

        }
        .card-depth {
            transform: translateZ(100px) scale(0.98);
            perspective: inherit;

        }

        .card-front {
            background: linear-gradient(to top left, #3a6186, #89253e);
            transform-style: preserve-3d;
        }

        .card-back {
            transform: rotateY(180deg);
            background: linear-gradient(to top left, #ffa17f, #00223e);
            transform-style: preserve-3d;
        }</style>
</head>
<body>
<div class="header">
    <h1>WELCOME</h1>
    <p>Click the card to see rotation</p>
</div>
<div class="cards-wrapper">
    <div class="card-container">
        <div class="card">
            <div class="card-contents card-front">
                <div class="card-depth">
                    <h2>个人信息</h2>
                    <hr>
                    <p>您的姓名：<span th:text="${realname}"></span></p>
                    <p>您的电话：<span th:text="${serialnumber}"></span></p>
                    <p>您的邮箱：<span th:text="${mailnumber}"></span></p>
                    <p>您的科目：<span th:text="${subjectname}"></span></p>
                </div>
            </div>
            <div class="card-contents card-back">
                <div class="card-depth">
                    <h2>个人信息</h2>
                    <hr>
                    <p>您的姓名：<span th:text="${realname}"></span></p>
                    <p>您的电话：<span th:text="${serialnumber}"></span></p>
                    <p>您的邮箱：<span th:text="${mailnumber}"></span></p>
                    <p>您的科目：<span th:text="${subjectname}"></span></p>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    const card = document.querySelector('.card');

    function clickRotate() {
        card.classList.toggle('rotated');
    }

    card.addEventListener('click', clickRotate);
</script>

</body>
</html>
